/* Specific styles for the Crossword Game */

.content-container {
    display: block;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.game-card {
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 900px;
}

/* The Grid Container */
.grid {
    display: grid !important;
    grid-template-columns: repeat(17, 1fr); 
    width: 100%;
    max-width: 680px;
    background-color: #1a1a1a; 
    gap: 1px;
    border: 1px solid #1a1a1a;
    margin: 20px auto;
    min-width: 300px;
}

/* Square Container */
.cell-wrapper {
    position: relative;
    background-color: white;
    aspect-ratio: 1 / 1;
    width: 100%;
    display: block;
}

/* The Letter Display */
.crossword-cell {
    width: 100%;
    height: 100%;
    display: flex; 
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: clamp(14px, 2vw, 22px); 
    font-weight: bold;
    text-transform: uppercase;
    color: var(--green, #2e7d32);
    user-select: none;
    background-color: white;
    line-height: 1; /* Keeps letter from drifting vertically */
}

/* Highlighted Selection */
.crossword-cell.selected {
    background-color: #56b259 !important; 
    box-shadow: inset 0 0 0 2px #2e7d32;
    color: black;
    z-index: 5;
}

.crossword-cell.focused-track {
    background-color: #c0efc4 !important;
}

.cell-number {
    position: absolute;
    top: 1px;
    left: 2px;
    font-size: 8px;
    color: var(--green, #2e7d32);
    font-weight: bold;
    pointer-events: none;
    z-index: 2;
}

/* Feedback Styles */
.crossword-cell.correct { 
    background-color: #70f696 !important;
    color: #000000 !important;
    border: 1px solid #137333;
}

.crossword-cell.incorrect { 
    background-color: #e8877e !important;
    color: #000000 !important;
    border: 1px solid #7e0b09 !important;
}

.controls {
    text-align: center;
    margin: 30px 0;
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
}

.clues-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    width: 100%;
    margin-top: 30px;
    border-top: 2px solid var(--accent, #ffd600);
    padding-top: 20px;
}

.clue-column ul li {
    list-style: none;
}

.alert-container {
    position: fixed;
    top: 10vh;
    left: 50vw;
    transform: translateX(-50%);
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.alert {
    display: block;
    background-color: var(--lightgreen);
    color: var(--white);
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 5px;
    transition: all 0.3s ease;
    margin: 20px auto 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.alert:last-child {
    margin-bottom: 0;
}

.alert.hide {
    opacity: 0;
}

@media (max-width: 600px) {
    .clues-container { 
        grid-template-columns: 1fr; 
    }
    .cell-number {
        font-size: 6px; /* Very small but still readable */
        top: 0;
        left: 0.5px;
    }
}

@media (min-width: 1024px) {
    .grid {
        min-width: 600px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .grid {
        min-width: 450px;
    }
    .cell-number {
        font-size: 6px; /* Very small but still readable */
        top: 0.5px;
        left: 0.5px;
    }
}

